package uk.ac.cam.echo;

import java.io.Serializable;
import java.sql.Date;
import uk.ac.cam.echo.app.DBInt;

/**
 * @author Tom Smith
 */
public class ScheduleEvent implements Serializable {

	private static final long serialVersionUID = 1L;
	private final String m_Name;
	private final String m_Description;
	private final long m_Start;
	private final long m_End;
	
	public ScheduleEvent(String eventName, String description, long start, long end) {
		this.m_Name = eventName;
		this.m_Description = description;
		this.m_Start = start;
		this.m_End = end;
	}

	/**
	 * @return the event name.
	 */
	public String getEventName() {
		return this.m_Name;
	}
	
	/**
	 * @return the event description.
	 */
	public String getEventDescription() {
		return this.m_Description;
	}

	/**
	 * @return a long representing the event start time in milliseconds since epoch.
	 */
	public long getStartTime() {
		return this.m_Start;
	}
	
	/**
	 * @return a long representing the event end time in milliseconds since epoch.
	 */
	public long getEndTime() {
		return this.m_End;
	}
	
	public String toString() {
		return DBInt.ShortDateFormat.format(new Date(getStartTime())) + " " + getEventName();
	}
}
